CREATE TABLE [dbo].[TDCANJ_PROV]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[CO_PROV] [dbo].[TD_VC_020] NOT NULL,
[NU_CANJ] [dbo].[TD_VC_008] NOT NULL,
[FE_CANJ] [dbo].[TD_DT_001] NOT NULL,
[NU_SECU_CANJ] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDCANJ_PR__NU_SE__5832119F] DEFAULT ((0)),
[NU_ORDE_LETR] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TDCANJ_PR__NU_OR__592635D8] DEFAULT ((0)),
[NU_LETR_PROV] [dbo].[TD_VC_020] NULL,
[CO_TIPO_DOCU] [dbo].[TD_VC_003] NULL,
[NU_DOCU_PROV] [dbo].[TD_VC_020] NULL,
[IM_DOCU] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_PR__IM_DO__5A1A5A11] DEFAULT ((0)),
[IM_SALD_DOCU] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_PR__IM_SA__5B0E7E4A] DEFAULT ((0)),
[IM_SALD_CONV] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_PR__IM_SA__5C02A283] DEFAULT ((0)),
[IM_DETA] [numeric] (16, 4) NULL CONSTRAINT [DF__TDCANJ_PR__IM_DE__5CF6C6BC] DEFAULT ((0)),
[IM_DETA_NEGA] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_PR__IM_DE__5DEAEAF5] DEFAULT ((0)),
[IM_CONV_DOCU] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_PR__IM_CO__5EDF0F2E] DEFAULT ((0)),
[ST_CIER_DOCU] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TDCANJ_PR__ST_CI__5FD33367] DEFAULT ('N'),
[IM_CANJ_MDOC] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_PR__IM_CA__61BB7BD9] DEFAULT ((0)),
[IM_CANJ_MCAN] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_PR__IM_CA__62AFA012] DEFAULT ((0)),
[CO_ESTA_ORIG] [dbo].[TD_VC_003] NULL,
[CO_USUA_CREA] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF__TDCANJ_PR__CO_US__63A3C44B] DEFAULT (suser_sname()),
[FE_USUA_CREA] [datetime] NOT NULL CONSTRAINT [DF__TDCANJ_PR__FE_US__6497E884] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDCANJ_PR__CO_US__658C0CBD] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDCANJ_PR__FE_US__668030F6] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDCANJ_PROV] WITH NOCHECK ADD CONSTRAINT [CK__TDCANJ_PR__ST_CI__60C757A0] CHECK NOT FOR REPLICATION (([ST_CIER_DOCU]='N' OR [ST_CIER_DOCU]='S'))
GO
ALTER TABLE [dbo].[TDCANJ_PROV] ADD CONSTRAINT [PK__TDCANJ_P__5F95F07B0D25C822] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [CO_PROV], [NU_CANJ], [FE_CANJ], [NU_SECU_CANJ]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDCANJ_PROV] ADD CONSTRAINT [FK__TDCANJ_PROV__32423E38] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [CO_PROV], [NU_CANJ], [FE_CANJ]) REFERENCES [dbo].[TCCANJ_PROV] ([CO_EMPR], [CO_UNID_CONC], [CO_PROV], [NU_CANJ], [FE_CANJ])
GO
